package com.smmisia.shop.service;

import com.smmisia.shop.entity.ProductInventoryStream;
import com.baomidou.mybatisplus.extension.service.IService;
import com.smmisia.shop.request.InventoryRequest;
import com.smmisia.shop.response.ProductInventoryResponse;


public interface ProductInventoryStreamService extends IService<ProductInventoryStream> {

    /**
     * 初始化商品库存
     */
    public ProductInventoryResponse init(InventoryRequest request);

    /**
     * 获取商品库存
     */
    public Integer getInventory(InventoryRequest request);

    /**
     * 扣减商品库存
     * @param request
     * @return
     */
    public ProductInventoryResponse decrease(InventoryRequest request);

    /**
     * 获取商品库存扣减日志
     * @param request
     * @return
     */
    public String getInventoryDecreaseLog(InventoryRequest request);

    /**
     * 增加商品库存
     * @param request
     * @return
     */
    public ProductInventoryResponse increase(InventoryRequest request);

    /**
     * 失效商品库存
     * @param request
     */
    public void invalid(InventoryRequest request);
}
